package com.feiynn.study.mocktest.controller;

import com.feiynn.study.mocktest.model.Blog;
import com.feiynn.study.mocktest.service.BlogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Dean
 */
@RestController
@RequestMapping("/blog")
public class BlogController {
    @Resource
    private BlogService blogService;

    @GetMapping(value = "/{id}")
    public Blog getBlog(@PathVariable("id") Long id) {
        return blogService.getBlogById(id);
    }
}
